package edu.byu.intex2.data.bo;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.dao.EmployeeDAO;

/**
 * @author Jason Whiting
 */
public class Employee extends Person
{

    private String username;
    private String password;
    private String position;

    // Global variables for the class
    public static final String SALESPERSON = "Salesperson";
    public static final String TECHNICIAN = "Technician";

    /**
     * Creates a new instance of BusinessObject
     * @param id
     */
    public Employee(String id)
    {
        super(id);
    }//constructor

    //Quick Access Method
    @Override
    public void save() throws DataException
    {
        try
        {
            EmployeeDAO.getInstance().save(this);
        } catch (DataException e)
        {
            e.printStackTrace();
        }
    }

    /**
     * @return the username
     */
    public String getUsername()
    {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username)
    {
        this.username = username;
        setDirty();
    }

    /**
     * @return the password
     */
    public String getPassword()
    {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password)
    {
        this.password = password;
        setDirty();
    }

    /**
     * @return the position
     */
    public String getPosition()
    {
        return position;
    }

    /**
     * @param position the position to set
     */
    public void setPosition(String position)
    {
        this.position = position;
        setDirty();
    }
}
